package com.ch.forum.controller;

import com.ch.forum.bo.ResponseResult;
import com.ch.forum.service.SystemParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/sys")
@RestController
public class SystemParamController {

    @Autowired
    private SystemParamService systemParamService;

    @GetMapping()
    public ResponseResult findAll(){
        return systemParamService.findAll();
    }

    @PostMapping()
    public ResponseResult update(String name, String value){
        return systemParamService.updateValue(name, value);
    }
}
